/*
 * @Author: zq
 * @Date: 2022-03-12 13:59:33
 * @LastEditTime: 2022-03-12 14:37:03
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \nien-vue3-admin\src\api\expressManager\orderList.ts
 */
import request from '@/utils/request'
// 创建订单
export const createOrder = function (data) {
  return request({
    url: 'order/order/info',
    method: 'post',
    data,
  })
}

// 订单列表
export function getlistOrder(params) {
  return request({
    url: 'order/info/listOrder',
    params,
  })
}
// 客户
export const listByCode = () => request({
  url: '/system/customer/custlist',
  method: 'get',
   
})
// 产品列表
export function productsList(SellingProductsByNameDto) {
  return request({
    url: 'system/product/selectProductsByNameType',
    method: 'post',
    data: SellingProductsByNameDto,
  })
}
export function uploadPOD(data) {
  return request({
    url: 'order/order/info/uploadPOD',
    method: 'post',
    data,
  })
} 
// 订单详情接口
export function getOrderDetail(id) {
  return request({
    url: `order/order/info/${ id }`,
    method: 'get',
  })
}
/// / 获取品类信息
export function getOrderCategory(params) {
  return request({
    url: 'order/safeguardByOrder/printOrderList',
    method: 'get',
    params,
  })
}
export function getOrderCategoryId(id) {
  return request({
    url: `order/safeguardByOrder/printOrderList/${ id }`,
    method: 'get',
    
  })
}

// 打标签
export function PlayBarCode(data) {
  return request({
    url: 'order/order/info/barCode',
    method: 'post',
    data,
  })
} 

// 打印面单
export function downLoadTag(data) {
  return request({
    url: 'order/tagInfo/downLoadTag',
    method: 'post',
    data,
  })
}
// 修改价格
export function editPrice(data) {
  return request({
    url: 'order/order/info/batchUpdateUnitPrice',
    method: 'post',
    data,
  })
} 

// 拣货完成
export function pickingIsComplete(data) {
  return request({
    url: 'order/order/info/pickingIsComplete',
    method: 'post',
    data,
  })
} 
// 导入订单
// /order/info/importOrder/{deptId}/{transportType}/{detail}/{dataSource}
export function importOrder(deptId, dataSource, data) {
  return request({
    url: `order/order/info/importOrder/${ deptId }/${ dataSource }`,
    method: 'post',
    data,
  })
} 
// 导入轨迹
export function emsTrackUpdate(data) {
  return request({
    url: 'order/ems/emsTrackUpdate',
    method: 'post',
    data,
  })
} 

export function ddHandle(data) {
  return request({
    url: `order/order/info/importOrder/${ data }`,
    method: 'post',
  })
} 
// 签入
export function editOrderStatus(data) {
  return request({
    url: 'order/order/info/editOrderStatus/1',
    method: 'post',
    data,
  })
}
export function editOrderStatus4(data) {
  return request({
    url: 'order/order/info/editOrderStatus/4',
    method: 'post',
    data,
  })
}
export function editOrderStatus9(data) {
  return request({
    url: 'order/order/info/editOrderStatus/9',
    method: 'post',
    data,
  })
}
// 强制制单
export function forcePlaceOrder(data) {
  return request({
    url: `order/order/info/compelPrint/${ data }`,
    method: 'delete',
  })
}
// 轨迹信息
export function fedexOrderNo(orderNo) {
  return request({
    url: `order/orderTrack/${ orderNo }`,
    method: 'post',
  })
}

export function pushEmsTrack(data) {
  return request({
    url: 'order/ems/pushEmsTrack',
    method: 'post',
    data,
  })
}
export function saveTrackInfo(data) {
  return request({
    url: '/order/orderTrack/saveTrackInfo',
    method: 'post',
    data,
  })
}
export function orderTrack(data) {
  return request({
    url: 'order/orderTrack',
    method: 'put',
    data,
  })
}
// 应收信息
export function receivable(params) {
  return request({
    url: 'finance/receivable/list',
    method: 'get',
    params,
  })
}
// 详情页修改

export function editOrderInfo(data) {
  return request({
    url: 'order/order/info/editOrderInfo',
    method: 'put',
    data,
  })
} 

export function editOrder(data) {
  return request({
    url: 'order/order/info',
    method: 'put',
    data,
  })
} 
// 添加或修改订单品类信息

export function safeguardByOrder(data) {
  return request({
    url: 'order/safeguardByOrder/add',
    method: 'post',
    data,
  })
}
// 退回制单

export function updateOrderStatus(params) {
  return request({
    url: 'order/order/info/updateOrderStatus',
    method: 'get',
    params,
  })
} 
// 扣件

export function kj(orderNo) {
  return request({
    url: `order/order/info/fasteners/${ orderNo }`,
    method: 'get',
   
  })
}

// 应收费
export function ysLists(ladingNo) {
  return request({
    url: `finance/customsClearanceReceivable/queryCustomsClearanceReceivableList/${ ladingNo }`,
    method: 'post',
    
  })
}
// 撤单

export function deleteInfo(ids, data) {
  return request({
    url: `order/order/info/${ ids }`,
    method: 'delete',
    data,
  })
}
// 费用名称
export function feeTypeList(data) {
  return request({
    url: 'system/feeType/list',
    method: 'post',
    data,
  })
}
// 初始化打单

export function initUpsData(orderNo) {
  return request({
    url: `order/order/info/initPackageInfo/${ orderNo }`,
    method: 'post',
    
  })
}
// 打印卡派面单

export function getEmsOrderNO(data) {
  return request({
    url: 'order/ems/getEmsOrderNO',
    method: 'post',
    data,
  })
}
// 货物图片上传
export function delGoodsImages(orderNo, data) {
  return request({
    url: `order/order/info/delGoodsImages/${ orderNo }`,
    method: 'post',
    data,
  })
}

export function saveGoodsImages(orderNo, data) {
  return request({
    url: `order/order/info/saveGoodsImages/${ orderNo }`,
    method: 'post',
    data,
    
  })
}
// 财务应收费

export function geReceivable(params) {
  return request({
    url: 'finance/receivable/list',
    method: 'get',
    params,
  })
}
// 查看pod

export function selectPod(params) {
  return request({
    url: 'order/order/info/selectPod',
    method: 'get',
    params,
  })
}
// 下载发票

export function downloadInvoiceOrderFile(data) {
  return request({
    url: 'order/order/info/downloadInvoiceOrderFile',
    method: 'post',
    data,
  })
}